import java.util.*;

/**
 * NC202487 打怪升级
 * https://ac.nowcoder.com/acm/problem/202487
 */
public class Main {
    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        Set<String> hash = new HashSet<>();
        while(n-- != 0)
        {
            char[] tem = in.next().toCharArray();
            Arrays.sort(tem);
             tem.toString();
            hash.add(new String(tem));
        }
        System.out.println(hash.size());
    }
}

/**
 * 字符串分类
 * https://www.nowcoder.com/questionTerminal/9fbb4d95e6164cd9ab52e859fbe8f4ec
 */
class Test{
    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        while(t-- != 0)
        {
            int h = in.nextInt(),a = in.nextInt(),H = in.nextInt(),A = in.nextInt();

            if(a >= H) System.out.println(-1);
            else{
                //1.计算打死一只怪的次数
                int x = H / a + ( H % a == 0 ? 0 : 1);

                //2.计算打死一只怪勇士掉的血量
                int m = (x - 1) * A;

                //3.计算打死怪兽的个数
                int cnt = h / m - (h % m == 0 ? 1 : 0);

                System.out.println(cnt);
            }

        }
    }
}
/**
 * NC345 城市群数量
 * https://www.nowcoder.com/practice/71cde4dee669475f94d8d38832374ada?tpId=196&tqId=40411&ru=/exam/oj
 */
class Solution
{
    boolean vis[] = new boolean[210];
    int n;

    public int citys (ArrayList<ArrayList<Integer>> m)
    {
        n = m.size();
        int ret = 0;
        for(int i = 0;i < n;i++)
        {
            if(vis[i] == false)
            {
                ret++;
                dps(m,i);
            }
        }
        return ret;
    }

    public void dps(ArrayList<ArrayList<Integer>> m,int pos)
    {
        vis[pos] = true;
        for(int i = 0;i < n;i++)
        {
            if(vis[i] == false && m.get(pos).get(i) == 1)
            {
                dps(m,i);
            }
        }
    }
}